const express = require('express');
const path = require("path")
const noteModel = require('../db/models/noteModel');

const loginVerify = require('../middleware/loginVerify');

const router = express.Router();

router.get('/',(req,res)=>{
    res.redirect('/list');
})

// 展示新增笔记页面 - 路由
router.get('/add',loginVerify,(req,res)=>{
    res.sendFile(path.resolve(__dirname, "../views/add.html"))
})

//笔记列表页
router.get('/list',(req,res)=>{
   
    res.sendFile(path.resolve(__dirname,"../views/list.html"))
})

//笔记编辑页面
router.get('/edit',loginVerify,(req,res)=>{

    res.sendFile(path.resolve(__dirname, "../views/edit.html"))
})


module.exports = router;